package com.learn._3stack;

import com.learn._2list.LinkedList;

public class LinkedStack<T> extends LinkedList<T> implements Stack<T> {
    @Override
    public void push(T obj) {
        add(obj);
    }

    @Override
    public T pop() {
        T res = peek();
        remove(size() - 1);
        return res;
    }

    @Override
    public T peek() {
        return get(size() - 1);
    }
}
